package com.mijie.homi.dao.chat;

import java.util.HashMap;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.mijie.core.IBatisDao;
import com.mijie.homi.common.domain.chat.ChatMessage;

@Repository
public class ChatMessageDao extends IBatisDao{

	public List<ChatMessage> listChatMessage(int userId){
		return this.selectList("listChatMessage", userId);
	}
	
	public int blockUser(int userId,int intruder){
		HashMap<String,Object> parameter = new HashMap<String,Object>();
		parameter.put("userId", userId);
		parameter.put("intruder", intruder);
		return this.insert("blockUser", parameter);
	}
	
	public int unblockUser(int userId,int intruder){
		HashMap<String,Object> parameter = new HashMap<String,Object>();
		parameter.put("userId", userId);
		parameter.put("intruder", intruder);
		return this.delete("unblockUser", parameter);
	}
}
